package st.business.tepth.business.user.operationchoose;

import java.util.List;

import st.business.tepth.base.OnDataConvertListener;
import st.business.tepth.business.bean.OperationBean;

/**
 * Author: shadow
 * Email:  1025431817@qq.com
 * Time:   2019-03-19 09:40
 */

public class OperationChoosePresenter extends OperationChooseContract.Presenter {
    private final OperationChooseContract.View mView;
    private final OperationChooseContract.Model mModel;

    public OperationChoosePresenter(OperationChooseContract.View view) {
        mView = view;
        mModel = new OperationChooseModel();
    }

    @Override
    void getOperationList(String token) {
        addDisposable(mModel.getOperationList(token, new OnDataConvertListener<List<OperationBean>>() {
            @Override
            public void convert(List<OperationBean> list) {
                mView.showOperationList(list);
            }

            @Override
            public void error(int code, String msg) {
                mView.showError(code, msg);
            }
        }));
    }
}
